treeview: Add back a check to ignore buttons > 3
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 22 Jul 2014 11:03:22 +0000 (13:03 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 22 Jul 2014 11:20:13 +0000 (13:20 +0200)
The removal was not intentional, and still needed as the GtkGestureMultiPress
will work for any button unless told to lock on a single specific one.

gtk/gtktreeview.c

index e648ffc2b89bec3fbba709ea2081a27bd5b626b2..5e24060477eeaf28eaee8b24bd72b11b47aa8501 100644 (file)
@@ -3078,13 +3078,19 @@ gtk_tree_view_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
                        "vertical-separator", &vertical_separator,
                        "horizontal-separator", &horizontal_separator,
                        NULL);
+  button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));
+
+  if (button > 3)
+    {
+      gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_DENIED);
+      return;
+    }
 
   /* Because grab_focus can cause reentrancy, we delay grab_focus until after
    * we're done handling the button press.
    */
   gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, x, y,
                                                      &bin_x, &bin_y);
-  button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));
   gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
 
   if (n_press > 1)